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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.u: D = None
        self.txt = txt

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

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