class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.y: H = None
        self.t: C = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: D = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.q: B = None
        self.p: B = None
        self.s: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.y: H = None
        self.t: C = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: D = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.q: B = None
        self.p: B = None
        self.s: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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