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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

e = A("e")
k = B("k")
b = C("b")
m = D("m")
i = E("i")
d = A("d")
c = A("c")

e.p = m
e.u = i
k.y = b
b.w = d
b.x = k
b.t = m
m.o = i
m.u = i
m.x = e
i.v = m
d.p = m
d.u = i
c.p = m
c.u = i
assert i.v.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

e = A("e")
k = B("k")
b = C("b")
m = D("m")
i = E("i")
d = A("d")
c = A("c")

e.p = m
e.u = i
k.y = b
b.w = d
b.x = k
b.t = m
m.o = i
m.u = i
m.x = e
i.v = m
d.p = m
d.u = i
c.p = m
c.u = i
assert i.v.u.v.u.txt == "i"