class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: H = None
        self.u: E = None
        self.r: G = None
        self.o: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.t: B = None
        self.z: H = None
        self.r: I = None
        self.w: D = None
        self.p: F = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: A = None
        self.o: E = None
        self.x: H = None
        self.t: G = None
        self.u: E = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.x: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: H = None
        self.u: E = None
        self.r: G = None
        self.o: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.t: B = None
        self.z: H = None
        self.r: I = None
        self.w: D = None
        self.p: F = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: A = None
        self.o: E = None
        self.x: H = None
        self.t: G = None
        self.u: E = None
        self.r: A = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: H = None
        self.x: C = None
        self.txt = txt

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

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