class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: F = None
        self.w: E = None
        self.o: C = None
        self.y: C = None
        self.p: H = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.s: D = None
        self.o: H = None
        self.r: A = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.w: B = None
        self.q: D = None
        self.p: F = None
        self.u: A = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.y: C = None
        self.z: F = None
        self.t: H = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.x: C = None
        self.y: H = None
        self.txt = txt

b = A("b")
m = B("m")
i = C("i")
f = D("f")
n = E("n")
d = F("d")
k = G("k")
a = H("a")
l = A("l")
h = H("h")

b.w = d
b.p = d
m.u = k
m.x = k
m.t = d
m.w = n
m.o = i
m.y = i
m.p = a
i.z = d
i.w = d
i.s = f
i.o = a
i.r = b
i.t = k
f.v = h
f.o = n
f.s = k
n.v = f
n.o = f
n.q = f
n.w = m
n.p = d
n.u = b
n.r = i
d.s = n
k.p = h
k.s = n
k.y = i
k.z = d
k.t = a
k.x = m
k.v = m
a.p = n
a.z = i
a.x = i
a.y = h
l.w = d
l.p = d
h.p = n
h.z = i
h.x = i
h.y = a
assert i.r.p.s.o.v.y.y.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: F = None
        self.w: E = None
        self.o: C = None
        self.y: C = None
        self.p: H = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.s: D = None
        self.o: H = None
        self.r: A = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.w: B = None
        self.q: D = None
        self.p: F = None
        self.u: A = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.y: C = None
        self.z: F = None
        self.t: H = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.x: C = None
        self.y: H = None
        self.txt = txt

b = A("b")
m = B("m")
i = C("i")
f = D("f")
n = E("n")
d = F("d")
k = G("k")
a = H("a")
l = A("l")
h = H("h")

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