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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.p: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: B = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: D = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

b = A("b")
e = B("e")
j = C("j")
l = D("l")
c = E("c")
n = F("n")

b.t = j
e.v = c
e.u = j
e.p = j
j.t = c
j.r = c
j.p = n
j.o = l
l.p = j
l.o = j
l.s = e
c.z = n
c.v = l
c.q = b
n.w = b
assert e.v.q.t.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.p: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: B = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: D = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

b = A("b")
e = B("e")
j = C("j")
l = D("l")
c = E("c")
n = F("n")

b.t = j
e.v = c
e.u = j
e.p = j
j.t = c
j.r = c
j.p = n
j.o = l
l.p = j
l.o = j
l.s = e
c.z = n
c.v = l
c.q = b
n.w = b
assert e.v.q.t.o.o.o.txt == "l"