class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: A = None
        self.s: E = None
        self.u: B = None
        self.p: C = None
        self.txt = txt

b = A("b")
d = B("d")
f = C("f")
e = D("e")
n = E("n")
h = D("h")
m = C("m")
j = A("j")
c = D("c")
l = E("l")

b.t = d
b.u = j
d.w = j
f.o = l
f.t = j
e.r = h
e.y = h
e.p = d
n.o = m
n.q = b
n.s = l
n.u = d
n.p = f
h.r = e
h.p = d
h.y = c
m.o = l
m.t = b
j.t = d
j.u = b
c.r = h
c.y = h
c.p = d
l.o = m
l.p = m
l.q = b
l.s = n
l.u = d
assert e.p.w.u.t.w.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: A = None
        self.s: E = None
        self.u: B = None
        self.p: C = None
        self.txt = txt

b = A("b")
d = B("d")
f = C("f")
e = D("e")
n = E("n")
h = D("h")
m = C("m")
j = A("j")
c = D("c")
l = E("l")

b.t = d
b.u = j
d.w = j
f.o = l
f.t = j
e.r = h
e.y = h
e.p = d
n.o = m
n.q = b
n.s = l
n.u = d
n.p = f
h.r = e
h.p = d
h.y = c
m.o = l
m.t = b
j.t = d
j.u = b
c.r = h
c.y = h
c.p = d
l.o = m
l.p = m
l.q = b
l.s = n
l.u = d
assert e.p.w.u.t.w.u.t.txt == "d"