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

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

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

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

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

j = A("j")
d = B("d")
k = C("k")
m = D("m")
f = E("f")
e = C("e")

j.y = e
d.y = f
d.t = e
k.x = d
k.o = j
k.u = j
m.r = j
m.o = f
m.t = k
f.o = d
f.z = k
f.u = k
f.w = j
f.x = m
e.x = d
e.o = j
e.u = j
assert k.o.y.u.y.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

j = A("j")
d = B("d")
k = C("k")
m = D("m")
f = E("f")
e = C("e")

j.y = e
d.y = f
d.t = e
k.x = d
k.o = j
k.u = j
m.r = j
m.o = f
m.t = k
f.o = d
f.z = k
f.u = k
f.w = j
f.x = m
e.x = d
e.o = j
e.u = j
assert k.o.y.u.y.u.y.txt == "e"