class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.u: G = None
        self.o: E = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: A = None
        self.o: A = None
        self.t: A = None
        self.y: G = None
        self.txt = txt

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

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

m.s = n
m.x = e
m.r = j
e.z = b
e.s = j
d.w = n
d.z = n
d.u = a
d.y = c
d.o = b
j.w = a
j.u = a
j.r = d
j.o = k
j.x = c
j.s = b
k.x = c
b.w = n
b.o = n
b.x = m
b.t = m
b.y = a
a.t = k
a.o = j
a.w = c
n.s = m
n.x = e
n.r = j
c.w = m
c.z = m
c.u = a
c.y = d
c.o = b
assert m.x.z.y.t.x.u.w.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.u: G = None
        self.o: E = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: A = None
        self.o: A = None
        self.t: A = None
        self.y: G = None
        self.txt = txt

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

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

m.s = n
m.x = e
m.r = j
e.z = b
e.s = j
d.w = n
d.z = n
d.u = a
d.y = c
d.o = b
j.w = a
j.u = a
j.r = d
j.o = k
j.x = c
j.s = b
k.x = c
b.w = n
b.o = n
b.x = m
b.t = m
b.y = a
a.t = k
a.o = j
a.w = c
n.s = m
n.x = e
n.r = j
c.w = m
c.z = m
c.u = a
c.y = d
c.o = b
assert m.x.z.y.t.x.u.w.z.s.txt == "n"