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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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