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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.y: E = None
        self.p: G = None
        self.x: D = None
        self.r: F = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: I = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: D = None
        self.o: A = None
        self.v: B = None
        self.p: I = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: E = None
        self.y: E = None
        self.p: G = None
        self.x: D = None
        self.r: F = None
        self.w: D = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: I = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: D = None
        self.o: A = None
        self.v: B = None
        self.p: I = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

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