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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.o: C = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.q: F = None
        self.z: F = None
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.o: C = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.q: F = None
        self.z: F = None
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

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

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