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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.q: D = None
        self.u: F = None
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.t: A = None
        self.y: C = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

g = A("g")
a = B("a")
e = C("e")
f = D("f")
i = E("i")
l = F("l")

g.u = l
g.z = a
a.v = l
e.y = g
e.x = g
e.o = g
e.z = i
e.q = f
e.u = l
f.t = e
i.s = e
i.v = g
l.w = g
l.s = g
l.t = g
l.v = g
l.y = e
l.u = i
assert f.t.q.t.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.q: D = None
        self.u: F = None
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.t: A = None
        self.y: C = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

g = A("g")
a = B("a")
e = C("e")
f = D("f")
i = E("i")
l = F("l")

g.u = l
g.z = a
a.v = l
e.y = g
e.x = g
e.o = g
e.z = i
e.q = f
e.u = l
f.t = e
i.s = e
i.v = g
l.w = g
l.s = g
l.t = g
l.v = g
l.y = e
l.u = i
assert f.t.q.t.x.u.txt == "l"