/*
//반 애들 이름 입력하기
import java.util.*;
public class Main{
class LinkedList<E>{
class Node<E>{
private E data;
private Node<E> next;
Node(E data, Node<E> next){
this.data = data;
this.next = next;
}
}
private Node<E> head;
private Node<E> crnt; //로 조지기
private Node<E> pre;
private Node tail;
public void add(String x) {
Node v = new Node(x, null);
v.next = head.next;
head.next = v;
crnt.next = v;
}
public LinkedList() {
head.next = tail;
crnt.next = tail;
tail = null;
}
public void no() {
if(head.next!=null) {
pre = head.next;
if(pre.next != null) {
pre = pre.next;
}else {
crnt = pre;
}
}
}
}
public Main() {
Scanner s = new Scanner(System.in);
int x = s.nextInt();
String[] arr = new String[x];
LinkedList li = new LinkedList();
for(int i=0; i<arr.length; i++) {
System.out.print("이름을 입력하세요 :");
arr[i] = s.nextLine();
li.add(arr[i]);
}
}
public static void main(String[] args) {
new Main();
}
}
*/
import java.util.*;
class LinkedList<E>{
class Node{
private String data;
private Node next;
public Node(String data, Node Next) {
this.data = data;
this.next = Next;
}
}
private Node head;
private Node tail;
private Node crnt;
private Node pre;
public void add(String x) {
Node v = new Node(x, null);
v.next = head.next;
head.next = v;
crnt.next = v;
}
public void pop() {
if(head.next != null) {
pre = head.next;
if(pre.next != null) {
pre = pre.next;
}else {
crnt = pre;
pre = null;
}
}
}
public void see() {
if(head.next != null) {
pre=head.next;
System.out.println(pre.data);
if(pre.next != null) {
pre = pre.next;
System.out.println(pre.data);
}else {
crnt = pre;
}
}
}
public LinkedList(){
head.next= tail;
crnt.next= tail;
tail = null;
}
}
public class Main{
public Main() {
Scanner s = new Scanner(System.in);
int x = s.nextInt();
LinkedList lis = new LinkedList();
String[] str = new String[x];
for(int i=0; i<str.length; i++) {
System.out.println("이름을 입력하세요 : ");
str[i]=s.nextLine();
lis.add(str[i]);
}
}
public static void main(String[] args) {
new Main();
}
}