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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.txt = txt

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

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

e.u = f
e.x = d
e.y = k
c.y = k
d.w = a
d.o = a
m.q = g
m.v = d
k.z = e
k.s = m
k.u = c
f.u = i
f.x = a
f.y = k
g.u = i
g.x = d
g.y = k
h.q = i
h.v = a
a.w = d
a.o = d
i.u = e
i.x = d
i.y = k
assert f.u.u.u.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.txt = txt

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

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

e.u = f
e.x = d
e.y = k
c.y = k
d.w = a
d.o = a
m.q = g
m.v = d
k.z = e
k.s = m
k.u = c
f.u = i
f.x = a
f.y = k
g.u = i
g.x = d
g.y = k
h.q = i
h.v = a
a.w = d
a.o = d
i.u = e
i.x = d
i.y = k
assert f.u.u.u.u.x.txt == "d"