class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: B = None
        self.s: E = None
        self.p: H = None
        self.v: F = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.p: I = None
        self.r: F = None
        self.s: A = None
        self.t: D = None
        self.v: A = None
        self.w: C = None
        self.txt = txt

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

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

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

k.r = l
a.r = e
a.p = f
a.o = f
a.v = f
a.w = i
a.q = i
a.s = i
a.x = d
a.y = d
n.r = c
n.q = a
n.s = f
n.p = l
n.w = l
n.v = d
e.o = d
e.q = f
e.x = l
f.t = i
f.v = l
f.u = l
f.w = a
f.r = a
f.s = a
d.x = k
i.u = e
i.t = e
i.q = n
i.w = n
i.p = c
i.r = d
i.s = k
i.v = k
l.s = c
l.w = d
l.o = d
l.p = i
l.y = f
l.r = e
c.p = k
c.u = l
assert n.r.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: B = None
        self.s: E = None
        self.p: H = None
        self.v: F = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.p: I = None
        self.r: F = None
        self.s: A = None
        self.t: D = None
        self.v: A = None
        self.w: C = None
        self.txt = txt

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

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

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

k.r = l
a.r = e
a.p = f
a.o = f
a.v = f
a.w = i
a.q = i
a.s = i
a.x = d
a.y = d
n.r = c
n.q = a
n.s = f
n.p = l
n.w = l
n.v = d
e.o = d
e.q = f
e.x = l
f.t = i
f.v = l
f.u = l
f.w = a
f.r = a
f.s = a
d.x = k
i.u = e
i.t = e
i.q = n
i.w = n
i.p = c
i.r = d
i.s = k
i.v = k
l.s = c
l.w = d
l.o = d
l.p = i
l.y = f
l.r = e
c.p = k
c.u = l
assert n.r.p.r.txt == "l"