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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: G = None
        self.p: A = None
        self.y: C = None
        self.x: G = None
        self.z: D = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.q: B = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

n = A("n")
m = B("m")
a = C("a")
b = D("b")
d = E("d")
c = F("c")
l = G("l")

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: G = None
        self.p: A = None
        self.y: C = None
        self.x: G = None
        self.z: D = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: A = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.q: B = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

n = A("n")
m = B("m")
a = C("a")
b = D("b")
d = E("d")
c = F("c")
l = G("l")

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