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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.v: B = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
k = D("k")
b = E("b")
i = F("i")
g = G("g")
d = F("d")
l = A("l")
a = C("a")

n.q = l
n.o = l
n.s = l
n.r = b
n.z = m
m.o = g
e.t = k
e.u = d
e.z = n
k.r = m
k.v = m
k.x = e
k.u = i
k.t = d
b.x = l
i.y = k
i.r = k
g.u = n
d.y = k
d.r = k
l.q = n
l.o = n
l.s = n
l.r = b
l.z = m
a.t = k
a.u = d
a.z = l
assert m.o.u.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: A = None
        self.r: E = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.v: B = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

n = A("n")
m = B("m")
e = C("e")
k = D("k")
b = E("b")
i = F("i")
g = G("g")
d = F("d")
l = A("l")
a = C("a")

n.q = l
n.o = l
n.s = l
n.r = b
n.z = m
m.o = g
e.t = k
e.u = d
e.z = n
k.r = m
k.v = m
k.x = e
k.u = i
k.t = d
b.x = l
i.y = k
i.r = k
g.u = n
d.y = k
d.r = k
l.q = n
l.o = n
l.s = n
l.r = b
l.z = m
a.t = k
a.u = d
a.z = l
assert m.o.u.z.o.txt == "g"