class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: H = None
        self.o: C = None
        self.s: C = None
        self.u: I = None
        self.y: H = None
        self.z: D = None
        self.q: I = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: E = None
        self.v: E = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.w: E = None
        self.q: A = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: E = None
        self.s: I = None
        self.u: H = None
        self.t: A = None
        self.y: C = None
        self.o: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: E = None
        self.v: E = None
        self.u: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.w: E = None
        self.q: A = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: E = None
        self.s: I = None
        self.u: H = None
        self.t: A = None
        self.y: C = None
        self.o: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

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

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