class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.x: G = None
        self.u: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.p: D = None
        self.s: B = None
        self.q: E = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.p: D = None
        self.s: B = None
        self.q: E = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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