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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.x: B = None
        self.r: D = None
        self.w: B = None
        self.txt = txt

i = A("i")
g = B("g")
h = C("h")
a = D("a")
c = E("c")
j = F("j")
n = G("n")
m = A("m")

i.z = a
i.u = n
i.w = n
g.w = c
g.u = h
g.x = j
h.q = a
h.z = c
a.o = i
a.s = j
c.q = n
j.w = a
j.o = g
j.t = g
j.z = m
j.v = n
j.y = n
j.u = h
n.v = h
n.q = a
n.r = a
n.x = g
n.w = g
m.z = a
m.u = n
m.w = n
assert n.v.z.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.x: B = None
        self.r: D = None
        self.w: B = None
        self.txt = txt

i = A("i")
g = B("g")
h = C("h")
a = D("a")
c = E("c")
j = F("j")
n = G("n")
m = A("m")

i.z = a
i.u = n
i.w = n
g.w = c
g.u = h
g.x = j
h.q = a
h.z = c
a.o = i
a.s = j
c.q = n
j.w = a
j.o = g
j.t = g
j.z = m
j.v = n
j.y = n
j.u = h
n.v = h
n.q = a
n.r = a
n.x = g
n.w = g
m.z = a
m.u = n
m.w = n
assert n.v.z.q.v.txt == "h"