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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: I = None
        self.r: H = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.v: B = None
        self.y: E = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: I = None
        self.p: G = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.u: D = None
        self.v: A = None
        self.y: D = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.v: C = None
        self.s: A = None
        self.p: F = None
        self.q: C = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: I = None
        self.r: H = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.v: B = None
        self.y: E = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: I = None
        self.p: G = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.u: D = None
        self.v: A = None
        self.y: D = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.v: C = None
        self.s: A = None
        self.p: F = None
        self.q: C = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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