class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: A = None
        self.t: E = None
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.p: E = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

e.q = g
e.p = l
e.y = l
e.t = n
e.v = n
g.q = j
j.y = g
j.w = a
h.t = c
h.w = c
h.p = n
h.s = a
h.u = e
n.u = g
n.o = h
l.q = g
l.p = e
l.y = e
l.t = n
l.v = n
c.t = h
c.w = h
c.p = n
c.s = i
c.u = l
a.u = g
a.o = h
i.u = g
i.o = h
assert i.o.p.u.q.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: A = None
        self.t: E = None
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.p: E = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

e.q = g
e.p = l
e.y = l
e.t = n
e.v = n
g.q = j
j.y = g
j.w = a
h.t = c
h.w = c
h.p = n
h.s = a
h.u = e
n.u = g
n.o = h
l.q = g
l.p = e
l.y = e
l.t = n
l.v = n
c.t = h
c.w = h
c.p = n
c.s = i
c.u = l
a.u = g
a.o = h
i.u = g
i.o = h
assert i.o.p.u.q.w.u.txt == "g"