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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: E = None
        self.r: A = None
        self.t: H = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: I = None
        self.s: C = None
        self.r: C = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: E = None
        self.r: A = None
        self.t: H = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: I = None
        self.s: C = None
        self.r: C = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: C = None
        self.txt = txt

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

i.p = n
i.y = h
i.s = b
h.x = k
h.u = f
h.r = i
h.s = i
h.t = n
h.y = a
e.x = h
e.y = h
e.u = f
g.y = n
g.p = b
g.s = e
g.r = e
g.z = m
g.x = a
f.v = i
a.w = f
a.t = g
m.t = e
n.u = k
n.v = h
n.p = m
b.v = n
b.u = e
k.v = n
k.u = e
assert k.v.p.t.x.x.u.u.v.txt == "i"