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

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

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: H = None
        self.t: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: G = None
        self.w: A = None
        self.t: B = None
        self.q: B = None
        self.z: C = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: H = None
        self.t: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: G = None
        self.w: A = None
        self.t: B = None
        self.q: B = None
        self.z: C = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

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

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