class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: E = None
        self.z: D = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.v: A = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.v: A = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

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

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

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

c.y = e
c.x = e
c.z = l
c.q = h
f.u = g
g.z = f
g.q = b
g.v = c
g.y = h
g.r = h
d.r = k
d.t = f
d.o = c
b.p = c
b.w = c
j.z = f
j.q = b
j.v = k
j.y = h
j.r = h
e.p = k
e.w = c
k.y = b
k.x = e
k.z = l
k.q = j
l.r = k
l.o = k
l.t = f
h.z = f
h.q = b
h.v = k
h.y = g
h.r = g
assert k.z.o.x.p.q.z.u.z.txt == "f"