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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

i = A("i")
n = B("n")
f = C("f")
l = D("l")
b = C("b")
k = A("k")
c = C("c")
m = B("m")

i.p = l
i.u = l
i.o = m
n.t = m
n.y = k
f.z = l
l.o = k
l.w = k
b.z = l
k.p = l
k.u = l
k.o = n
c.z = l
m.t = n
m.y = i
assert m.t.y.p.o.o.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

i = A("i")
n = B("n")
f = C("f")
l = D("l")
b = C("b")
k = A("k")
c = C("c")
m = B("m")

i.p = l
i.u = l
i.o = m
n.t = m
n.y = k
f.z = l
l.o = k
l.w = k
b.z = l
k.p = l
k.u = l
k.o = n
c.z = l
m.t = n
m.y = i
assert m.t.y.p.o.o.t.t.txt == "n"