class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: B = None
        self.v: D = None
        self.s: C = None
        self.r: E = None
        self.q: G = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: I = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: I = None
        self.u: B = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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