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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: I = None
        self.z: B = None
        self.x: F = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: C = None
        self.v: B = None
        self.z: H = None
        self.x: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: I = None
        self.z: B = None
        self.x: F = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: C = None
        self.v: B = None
        self.z: H = None
        self.x: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

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

k.r = j
k.v = l
n.z = a
m.p = l
m.r = l
m.u = j
m.z = n
m.x = i
d.y = k
a.p = k
a.y = m
a.x = m
a.v = n
a.z = l
a.o = d
i.o = m
i.p = m
i.v = n
i.s = d
i.r = a
i.x = a
i.u = g
g.p = k
l.w = g
l.x = m
l.y = d
l.r = a
l.q = j
l.o = j
j.x = m
j.r = m
j.z = n
j.p = l
assert k.r.r.u.r.txt == "m"