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

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

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

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

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

i = A("i")
f = B("f")
m = C("m")
h = D("h")
l = E("l")
c = D("c")

i.y = m
i.s = f
i.z = f
i.x = l
f.x = i
f.t = i
f.o = l
m.u = f
h.t = i
h.w = f
l.p = i
c.t = i
c.w = f
assert f.t.s.o.p.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: B = None
        self.x: E = None
        self.z: B = None
        self.txt = txt

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

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

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

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

i = A("i")
f = B("f")
m = C("m")
h = D("h")
l = E("l")
c = D("c")

i.y = m
i.s = f
i.z = f
i.x = l
f.x = i
f.t = i
f.o = l
m.u = f
h.t = i
h.w = f
l.p = i
c.t = i
c.w = f
assert f.t.s.o.p.x.p.txt == "i"