class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.z: B = None
        self.o: B = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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