class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: D = None
        self.z: H = None
        self.v: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: A = None
        self.y: H = None
        self.x: E = None
        self.z: A = None
        self.w: E = None
        self.o: I = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: A = None
        self.y: H = None
        self.x: E = None
        self.z: A = None
        self.w: E = None
        self.o: I = None
        self.v: F = None
        self.txt = txt

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

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

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

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