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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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