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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.v: A = None
        self.p: H = None
        self.q: I = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: B = None
        self.x: G = None
        self.s: A = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.z: H = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.v: A = None
        self.p: H = None
        self.q: I = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: B = None
        self.x: G = None
        self.s: A = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.z: H = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

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