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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.z: G = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.z: G = None
        self.o: F = None
        self.txt = txt

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

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

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

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