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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: D = None
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: E = None
        self.q: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: D = None
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: E = None
        self.q: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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