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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: F = None
        self.z: D = None
        self.s: E = None
        self.t: H = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: F = None
        self.z: D = None
        self.s: E = None
        self.t: H = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

j.p = h
i.q = j
i.w = j
i.y = h
i.z = b
i.s = d
i.t = a
k.t = d
k.p = h
b.q = i
d.y = l
d.u = l
d.p = a
h.p = i
e.q = i
e.u = l
e.z = l
e.w = a
e.o = d
e.x = d
e.v = b
e.p = h
e.r = h
a.w = h
a.t = j
a.q = e
a.x = d
l.p = b
l.t = d
l.v = i
l.y = a
l.z = e
l.q = e
assert k.p.p.z.q.txt == "i"