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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.p: E = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.p: E = None
        self.s: A = None
        self.txt = txt

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

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