class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: D = None
        self.z: C = None
        self.r: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.y: E = None
        self.o: E = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: G = None
        self.t: B = None
        self.v: F = None
        self.p: E = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.y: E = None
        self.o: E = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: G = None
        self.t: B = None
        self.v: F = None
        self.p: E = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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