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

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

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

f = A("f")
d = B("d")
l = C("l")
i = B("i")
k = A("k")
b = B("b")
c = B("c")

f.s = d
f.u = l
d.t = b
d.p = l
d.u = f
l.z = f
l.s = f
l.y = d
i.t = d
i.p = l
i.u = k
k.s = b
k.u = l
b.t = d
b.p = l
b.u = f
c.t = i
c.p = l
c.u = k
assert i.t.p.y.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

f = A("f")
d = B("d")
l = C("l")
i = B("i")
k = A("k")
b = B("b")
c = B("c")

f.s = d
f.u = l
d.t = b
d.p = l
d.u = f
l.z = f
l.s = f
l.y = d
i.t = d
i.p = l
i.u = k
k.s = b
k.u = l
b.t = d
b.p = l
b.u = f
c.t = i
c.p = l
c.u = k
assert i.t.p.y.u.u.txt == "l"