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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: C = None
        self.o: H = None
        self.p: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: B = None
        self.r: H = None
        self.z: G = None
        self.p: D = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

i = A("i")
n = B("n")
l = C("l")
e = D("e")
b = E("b")
g = F("g")
k = G("k")
j = H("j")
m = I("m")
c = B("c")

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: C = None
        self.o: H = None
        self.p: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: B = None
        self.r: H = None
        self.z: G = None
        self.p: D = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

i = A("i")
n = B("n")
l = C("l")
e = D("e")
b = E("b")
g = F("g")
k = G("k")
j = H("j")
m = I("m")
c = B("c")

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