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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: A = None
        self.z: E = None
        self.v: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
j = C("j")
d = D("d")
c = E("c")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: A = None
        self.z: E = None
        self.v: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
j = C("j")
d = D("d")
c = E("c")
a = F("a")

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