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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: I = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: I = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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