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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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