class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: B = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: G = None
        self.v: D = 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.r: H = None
        self.x: F = None
        self.z: I = None
        self.t: C = None
        self.s: E = None
        self.w: B = None
        self.u: B = None
        self.y: I = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: I = None
        self.v: A = None
        self.p: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: G = None
        self.v: D = 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.r: H = None
        self.x: F = None
        self.z: I = None
        self.t: C = None
        self.s: E = None
        self.w: B = None
        self.u: B = None
        self.y: I = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: I = None
        self.v: A = None
        self.p: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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