class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.o: F = None
        self.u: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: H = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.u: G = None
        self.t: G = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: C = None
        self.t: E = None
        self.v: C = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: C = None
        self.v: H = None
        self.r: E = None
        self.txt = txt

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

k.p = a
k.r = i
k.o = i
k.u = f
j.y = c
j.r = d
j.q = i
j.x = i
a.s = c
a.x = h
a.z = h
a.u = j
a.v = j
l.y = k
l.o = f
l.r = j
m.t = a
m.s = k
i.z = f
d.z = a
d.q = a
d.u = c
d.t = c
d.v = h
f.x = h
f.z = a
f.v = a
f.t = m
f.w = j
h.x = i
h.o = a
h.v = f
h.r = m
c.z = a
c.q = a
c.u = d
c.t = d
c.v = h
assert a.v.y.v.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.o: F = None
        self.u: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: H = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.u: G = None
        self.t: G = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: C = None
        self.t: E = None
        self.v: C = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: C = None
        self.v: H = None
        self.r: E = None
        self.txt = txt

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

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