class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.p: C = None
        self.t: A = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.o: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

i = A("i")
e = B("e")
h = C("h")
k = D("k")
g = E("g")
j = E("j")
l = A("l")
f = B("f")
n = D("n")

i.y = g
i.r = h
i.p = h
i.t = l
i.q = k
e.y = n
e.r = g
e.o = h
e.x = h
h.s = i
h.x = i
h.q = f
k.w = g
g.o = j
g.q = e
g.t = h
j.o = g
j.q = f
j.t = h
l.y = g
l.r = h
l.p = h
l.t = i
l.q = n
f.y = k
f.r = g
f.o = h
f.x = h
n.w = g
assert g.t.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.p: C = None
        self.t: A = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.o: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: B = None
        self.t: C = None
        self.txt = txt

i = A("i")
e = B("e")
h = C("h")
k = D("k")
g = E("g")
j = E("j")
l = A("l")
f = B("f")
n = D("n")

i.y = g
i.r = h
i.p = h
i.t = l
i.q = k
e.y = n
e.r = g
e.o = h
e.x = h
h.s = i
h.x = i
h.q = f
k.w = g
g.o = j
g.q = e
g.t = h
j.o = g
j.q = f
j.t = h
l.y = g
l.r = h
l.p = h
l.t = i
l.q = n
f.y = k
f.r = g
f.o = h
f.x = h
n.w = g
assert g.t.x.q.txt == "k"