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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: I = None
        self.o: I = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.w: C = None
        self.z: G = None
        self.t: D = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.w: C = None
        self.p: E = None
        self.v: H = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: I = None
        self.o: I = None
        self.w: F = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.w: C = None
        self.z: G = None
        self.t: D = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.w: C = None
        self.p: E = None
        self.v: H = None
        self.u: B = None
        self.txt = txt

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

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