class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.t: G = None
        self.s: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.s: F = None
        self.q: D = None
        self.o: E = None
        self.p: F = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.t: G = None
        self.s: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: B = None
        self.s: F = None
        self.q: D = None
        self.o: E = None
        self.p: F = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

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