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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.p: G = None
        self.v: F = None
        self.o: E = None
        self.w: G = None
        self.y: I = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.z: H = None
        self.p: B = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.r: C = None
        self.x: F = None
        self.o: B = None
        self.z: F = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: F = None
        self.t: G = None
        self.x: A = None
        self.u: H = None
        self.o: A = None
        self.p: H = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.p: G = None
        self.v: F = None
        self.o: E = None
        self.w: G = None
        self.y: I = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: B = None
        self.z: H = None
        self.p: B = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.r: C = None
        self.x: F = None
        self.o: B = None
        self.z: F = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: F = None
        self.t: G = None
        self.x: A = None
        self.u: H = None
        self.o: A = None
        self.p: H = None
        self.y: A = None
        self.txt = txt

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

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

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