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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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