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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.w: A = None
        self.p: G = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: A = None
        self.txt = txt

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

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

e.q = k
k.r = l
k.z = n
k.u = n
k.x = h
g.v = m
h.y = k
h.w = k
h.v = m
h.p = m
h.t = c
h.r = g
h.u = g
n.q = e
n.v = m
n.w = m
n.p = l
n.u = f
c.z = l
c.x = m
l.v = h
l.y = k
j.y = k
j.w = k
j.v = m
j.p = m
j.t = c
j.r = g
j.u = g
f.q = m
f.v = e
f.w = e
f.p = l
f.u = n
m.q = k
assert c.x.q.x.w.u.q.q.x.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.w: A = None
        self.p: G = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: A = None
        self.txt = txt

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

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

e.q = k
k.r = l
k.z = n
k.u = n
k.x = h
g.v = m
h.y = k
h.w = k
h.v = m
h.p = m
h.t = c
h.r = g
h.u = g
n.q = e
n.v = m
n.w = m
n.p = l
n.u = f
c.z = l
c.x = m
l.v = h
l.y = k
j.y = k
j.w = k
j.v = m
j.p = m
j.t = c
j.r = g
j.u = g
f.q = m
f.v = e
f.w = e
f.p = l
f.u = n
m.q = k
assert c.x.q.x.w.u.q.q.x.u.v.txt == "m"