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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: A = None
        self.u: C = None
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.v: E = None
        self.r: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: A = None
        self.u: C = None
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.v: E = None
        self.r: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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