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

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

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

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

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

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

n = A("n")
c = B("c")
m = C("m")
i = D("i")
f = E("f")
g = F("g")
l = B("l")

n.q = m
n.p = f
n.r = i
n.o = g
n.v = c
n.s = c
c.s = n
c.o = n
c.w = m
c.r = m
c.x = g
c.p = f
m.z = c
i.z = f
i.y = n
i.r = c
i.x = g
f.z = i
f.o = m
f.q = n
f.v = n
f.s = l
f.w = l
g.q = i
g.x = i
g.w = f
g.z = f
g.v = f
l.s = n
l.o = n
l.w = m
l.r = m
l.x = g
l.p = f
assert l.p.q.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.r: D = None
        self.o: F = None
        self.v: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
c = B("c")
m = C("m")
i = D("i")
f = E("f")
g = F("g")
l = B("l")

n.q = m
n.p = f
n.r = i
n.o = g
n.v = c
n.s = c
c.s = n
c.o = n
c.w = m
c.r = m
c.x = g
c.p = f
m.z = c
i.z = f
i.y = n
i.r = c
i.x = g
f.z = i
f.o = m
f.q = n
f.v = n
f.s = l
f.w = l
g.q = i
g.x = i
g.w = f
g.z = f
g.v = f
l.s = n
l.o = n
l.w = m
l.r = m
l.x = g
l.p = f
assert l.p.q.p.z.txt == "i"