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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = 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.q: D = None
        self.o: B = None
        self.t: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = 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.q: D = None
        self.o: B = None
        self.t: E = None
        self.p: G = None
        self.txt = txt

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

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

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