class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: F = None
        self.x: A = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: A = None
        self.u: B = None
        self.o: C = None
        self.s: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: B = None
        self.z: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: F = None
        self.x: A = None
        self.u: E = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: A = None
        self.u: B = None
        self.o: C = None
        self.s: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: B = None
        self.z: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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