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

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

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

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

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

m = A("m")
e = B("e")
g = C("g")
d = D("d")
f = E("f")
l = A("l")
i = E("i")

m.x = l
m.z = e
m.y = e
m.s = i
m.w = d
e.x = i
e.y = i
e.z = f
e.t = d
g.z = e
g.u = e
g.o = f
g.s = i
d.r = m
d.x = g
d.p = f
f.y = i
l.x = m
l.z = e
l.y = e
l.s = f
l.w = d
i.y = f
assert i.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.s: E = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

m = A("m")
e = B("e")
g = C("g")
d = D("d")
f = E("f")
l = A("l")
i = E("i")

m.x = l
m.z = e
m.y = e
m.s = i
m.w = d
e.x = i
e.y = i
e.z = f
e.t = d
g.z = e
g.u = e
g.o = f
g.s = i
d.r = m
d.x = g
d.p = f
f.y = i
l.x = m
l.z = e
l.y = e
l.s = f
l.w = d
i.y = f
assert i.y.y.y.y.y.y.txt == "i"