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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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