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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.q: F = None
        self.w: F = None
        self.y: H = None
        self.txt = txt

h = A("h")
c = B("c")
g = C("g")
a = D("a")
l = E("l")
b = F("b")
j = G("j")
i = H("i")
m = I("m")
f = B("f")

h.v = m
h.p = m
h.u = g
c.r = b
g.p = j
g.x = j
a.z = h
l.q = f
l.y = h
l.s = i
l.r = m
b.o = j
b.v = g
j.r = h
j.y = h
j.z = g
j.x = m
j.p = i
j.o = f
j.t = c
j.w = b
i.x = b
i.q = b
i.y = l
i.u = l
i.o = h
i.p = j
i.t = m
i.r = m
i.v = f
m.t = c
m.o = g
m.q = b
m.w = b
m.y = i
f.r = b
assert h.u.p.w.o.z.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: C = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.q: F = None
        self.w: F = None
        self.y: H = None
        self.txt = txt

h = A("h")
c = B("c")
g = C("g")
a = D("a")
l = E("l")
b = F("b")
j = G("j")
i = H("i")
m = I("m")
f = B("f")

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