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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: F = None
        self.z: C = None
        self.txt = txt

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

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