class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: C = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: G = None
        self.o: E = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

g = A("g")
n = B("n")
m = C("m")
l = D("l")
e = E("e")
k = F("k")
j = G("j")
i = H("i")

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: G = None
        self.o: E = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

g = A("g")
n = B("n")
m = C("m")
l = D("l")
e = E("e")
k = F("k")
j = G("j")
i = H("i")

g.z = i
g.t = m
g.r = n
n.s = j
n.x = g
n.w = g
m.q = n
m.p = j
m.o = e
m.w = i
l.y = m
e.y = k
e.p = n
k.v = e
k.u = g
k.z = n
j.w = e
j.y = i
j.r = n
j.u = n
i.x = j
i.y = j
i.w = k
i.o = k
i.u = g
i.v = m
i.t = l
assert g.z.w.v.y.u.r.txt == "n"