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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.x: E = None
        self.v: C = None
        self.u: A = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

m = A("m")
c = B("c")
k = C("k")
n = D("n")
g = E("g")
j = F("j")
h = G("h")
d = C("d")
a = E("a")
l = B("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.x: E = None
        self.v: C = None
        self.u: A = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

m = A("m")
c = B("c")
k = C("k")
n = D("n")
g = E("g")
j = F("j")
h = G("h")
d = C("d")
a = E("a")
l = B("l")

m.t = h
m.r = h
m.w = n
m.y = j
m.z = k
c.q = m
c.v = m
c.o = h
k.t = m
n.w = l
n.o = m
n.u = m
n.q = m
n.x = g
n.z = g
n.v = d
g.t = n
g.u = k
j.x = d
h.s = n
h.u = k
h.r = l
d.t = m
a.t = n
a.u = k
l.q = m
l.v = m
l.o = h
assert g.u.t.r.u.t.w.x.t.txt == "n"