class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: E = None
        self.s: E = None
        self.q: A = None
        self.o: A = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.w: A = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: D = None
        self.o: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.w: A = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: D = None
        self.o: A = None
        self.txt = txt

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

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

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