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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
f = D("f")
a = E("a")
j = F("j")
b = G("b")

n.t = a
n.u = e
n.w = b
m.p = f
m.x = f
m.o = n
m.q = e
e.o = f
f.o = m
f.x = a
a.s = n
a.x = n
a.r = j
a.v = f
a.q = f
a.z = b
j.r = f
j.t = m
j.s = b
j.u = e
j.p = e
j.v = a
j.w = a
b.o = f
b.w = j
b.t = m
assert a.r.s.w.s.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.t: B = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
f = D("f")
a = E("a")
j = F("j")
b = G("b")

n.t = a
n.u = e
n.w = b
m.p = f
m.x = f
m.o = n
m.q = e
e.o = f
f.o = m
f.x = a
a.s = n
a.x = n
a.r = j
a.v = f
a.q = f
a.z = b
j.r = f
j.t = m
j.s = b
j.u = e
j.p = e
j.v = a
j.w = a
b.o = f
b.w = j
b.t = m
assert a.r.s.w.s.o.o.o.txt == "n"