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

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

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

l = A("l")
e = B("e")
n = C("n")
f = A("f")
a = A("a")
m = C("m")
i = B("i")

l.x = a
l.u = a
e.v = i
e.t = f
n.v = m
f.x = a
f.u = a
a.x = l
a.u = f
m.v = n
i.v = e
i.t = f
assert i.v.t.x.x.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
n = C("n")
f = A("f")
a = A("a")
m = C("m")
i = B("i")

l.x = a
l.u = a
e.v = i
e.t = f
n.v = m
f.x = a
f.u = a
a.x = l
a.u = f
m.v = n
i.v = e
i.t = f
assert i.v.t.x.x.u.u.txt == "f"