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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: D = None
        self.q: A = None
        self.t: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.q: C = None
        self.p: B = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
c = C("c")
b = D("b")
d = E("d")
l = F("l")

a.u = b
k.s = l
k.r = l
k.p = l
k.v = a
c.x = l
c.o = l
c.v = b
c.q = a
c.t = k
b.t = a
b.u = a
b.q = c
b.s = c
b.p = k
b.x = l
d.v = b
d.o = a
d.t = k
l.t = a
l.x = d
assert l.t.u.s.q.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: D = None
        self.q: A = None
        self.t: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: A = None
        self.q: C = None
        self.p: B = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
c = C("c")
b = D("b")
d = E("d")
l = F("l")

a.u = b
k.s = l
k.r = l
k.p = l
k.v = a
c.x = l
c.o = l
c.v = b
c.q = a
c.t = k
b.t = a
b.u = a
b.q = c
b.s = c
b.p = k
b.x = l
d.v = b
d.o = a
d.t = k
l.t = a
l.x = d
assert l.t.u.s.q.u.x.txt == "l"