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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: I = None
        self.x: I = None
        self.u: I = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: H = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: A = None
        self.r: B = None
        self.p: H = None
        self.w: F = None
        self.q: H = None
        self.t: B = None
        self.txt = txt

l = A("l")
a = B("a")
f = C("f")
h = D("h")
e = E("e")
m = F("m")
g = G("g")
n = H("n")
i = I("i")
c = C("c")

l.y = g
l.x = a
l.v = a
l.u = h
l.q = h
l.o = h
l.t = i
l.p = c
l.r = n
a.r = l
a.v = l
a.y = i
a.x = i
a.u = i
a.w = h
f.s = l
h.x = c
h.q = e
e.u = l
e.t = a
m.r = n
m.z = a
m.w = g
g.r = m
g.p = n
g.x = h
g.q = f
n.z = c
i.x = g
i.y = l
i.r = a
i.t = a
i.p = n
i.q = n
i.w = m
c.s = l
assert i.w.w.p.z.s.y.r.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: B = None
        self.u: D = None
        self.v: B = None
        self.t: I = None
        self.q: D = None
        self.p: C = None
        self.o: D = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: I = None
        self.x: I = None
        self.u: I = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: H = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: A = None
        self.r: B = None
        self.p: H = None
        self.w: F = None
        self.q: H = None
        self.t: B = None
        self.txt = txt

l = A("l")
a = B("a")
f = C("f")
h = D("h")
e = E("e")
m = F("m")
g = G("g")
n = H("n")
i = I("i")
c = C("c")

l.y = g
l.x = a
l.v = a
l.u = h
l.q = h
l.o = h
l.t = i
l.p = c
l.r = n
a.r = l
a.v = l
a.y = i
a.x = i
a.u = i
a.w = h
f.s = l
h.x = c
h.q = e
e.u = l
e.t = a
m.r = n
m.z = a
m.w = g
g.r = m
g.p = n
g.x = h
g.q = f
n.z = c
i.x = g
i.y = l
i.r = a
i.t = a
i.p = n
i.q = n
i.w = m
c.s = l
assert i.w.w.p.z.s.y.r.w.q.txt == "f"