class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.y: D = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.z: D = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

f = A("f")
a = B("a")
h = C("h")
d = D("d")
m = E("m")
n = A("n")
g = E("g")
k = B("k")

f.o = d
f.y = d
f.q = m
f.t = n
f.u = n
a.o = m
a.p = d
a.x = h
h.z = n
d.p = g
d.o = n
m.p = d
m.z = d
m.v = d
m.w = f
m.u = h
n.o = d
n.y = d
n.q = g
n.t = f
n.u = f
g.p = d
g.z = d
g.v = d
g.w = n
g.u = h
k.o = m
k.p = d
k.x = h
assert d.o.u.q.u.z.o.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.y: D = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.z: D = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

f = A("f")
a = B("a")
h = C("h")
d = D("d")
m = E("m")
n = A("n")
g = E("g")
k = B("k")

f.o = d
f.y = d
f.q = m
f.t = n
f.u = n
a.o = m
a.p = d
a.x = h
h.z = n
d.p = g
d.o = n
m.p = d
m.z = d
m.v = d
m.w = f
m.u = h
n.o = d
n.y = d
n.q = g
n.t = f
n.u = f
g.p = d
g.z = d
g.v = d
g.w = n
g.u = h
k.o = m
k.p = d
k.x = h
assert d.o.u.q.u.z.o.o.t.txt == "f"