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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: H = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: H = None
        self.s: E = None
        self.v: H = None
        self.t: I = None
        self.w: H = None
        self.z: A = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.w: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.t: D = None
        self.w: F = None
        self.q: B = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.o: E = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: E = None
        self.w: E = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: H = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: H = None
        self.s: E = None
        self.v: H = None
        self.t: I = None
        self.w: H = None
        self.z: A = None
        self.p: H = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.w: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.t: D = None
        self.w: F = None
        self.q: B = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.o: E = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: E = None
        self.w: E = None
        self.p: H = None
        self.txt = txt

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

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