class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: B = None
        self.s: H = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: H = None
        self.x: D = None
        self.t: E = None
        self.v: I = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: F = None
        self.s: G = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: H = None
        self.x: D = None
        self.t: E = None
        self.v: I = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: A = None
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: F = None
        self.s: G = None
        self.x: C = None
        self.txt = txt

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

l.p = m
l.s = m
l.x = n
l.o = i
n.o = l
n.w = c
i.s = l
i.q = m
i.x = j
i.t = d
i.z = d
i.v = f
j.v = l
j.s = i
j.z = b
d.o = c
b.r = d
b.y = d
b.q = l
c.t = b
c.v = m
m.w = c
m.s = i
m.o = b
f.o = j
f.z = b
f.s = c
f.x = i
assert i.z.o.v.txt == "m"