class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.v: B = None
        self.x: B = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.t: E = None
        self.v: D = None
        self.txt = txt

b = A("b")
a = B("a")
d = C("d")
j = D("j")
l = E("l")
m = F("m")

b.q = d
b.z = a
b.v = a
b.x = a
b.y = a
b.w = a
a.u = j
a.x = j
a.s = j
d.y = a
d.s = a
d.t = j
d.u = l
j.q = a
j.p = l
l.o = d
l.t = j
m.p = b
m.y = j
m.v = j
m.t = l
assert j.p.o.t.p.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.v: B = None
        self.x: B = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.t: E = None
        self.v: D = None
        self.txt = txt

b = A("b")
a = B("a")
d = C("d")
j = D("j")
l = E("l")
m = F("m")

b.q = d
b.z = a
b.v = a
b.x = a
b.y = a
b.w = a
a.u = j
a.x = j
a.s = j
d.y = a
d.s = a
d.t = j
d.u = l
j.q = a
j.p = l
l.o = d
l.t = j
m.p = b
m.y = j
m.v = j
m.t = l
assert j.p.o.t.p.t.q.txt == "a"