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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: I = None
        self.u: I = None
        self.q: E = None
        self.y: G = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: H = None
        self.y: C = None
        self.z: I = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.u: C = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: D = None
        self.p: E = None
        self.s: E = None
        self.q: A = None
        self.z: A = None
        self.u: D = None
        self.w: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: I = None
        self.u: I = None
        self.q: E = None
        self.y: G = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: H = None
        self.y: C = None
        self.z: I = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.u: C = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: D = None
        self.p: E = None
        self.s: E = None
        self.q: A = None
        self.z: A = None
        self.u: D = None
        self.w: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

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