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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: H = None
        self.r: H = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: H = None
        self.r: H = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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