class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: H = None
        self.y: H = None
        self.z: D = None
        self.q: E = None
        self.x: E = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.s: F = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

f = A("f")
k = B("k")
n = C("n")
l = D("l")
h = E("h")
g = F("g")
a = G("a")
m = H("m")
b = D("b")
j = A("j")

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: D = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.s: F = None
        self.v: A = None
        self.w: A = None
        self.txt = txt

f = A("f")
k = B("k")
n = C("n")
l = D("l")
h = E("h")
g = F("g")
a = G("a")
m = H("m")
b = D("b")
j = A("j")

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