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

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

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

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

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

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

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

c.q = k
c.t = e
c.z = e
c.y = e
c.x = l
j.v = n
j.q = c
j.p = c
j.y = k
j.t = e
e.t = l
k.y = j
k.x = c
l.x = e
l.z = j
n.x = k
n.p = l
n.t = l
assert c.q.x.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.z: C = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

c.q = k
c.t = e
c.z = e
c.y = e
c.x = l
j.v = n
j.q = c
j.p = c
j.y = k
j.t = e
e.t = l
k.y = j
k.x = c
l.x = e
l.z = j
n.x = k
n.p = l
n.t = l
assert c.q.x.q.x.txt == "c"