class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: B = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.u: D = None
        self.w: H = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: H = None
        self.u: E = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.u: A = None
        self.r: H = None
        self.txt = txt

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

b = A("b")
a = B("a")
h = C("h")
j = D("j")
f = E("f")
m = F("m")
c = G("c")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.u: D = None
        self.w: H = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: H = None
        self.u: E = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.u: A = None
        self.r: H = None
        self.txt = txt

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

b = A("b")
a = B("a")
h = C("h")
j = D("j")
f = E("f")
m = F("m")
c = G("c")
d = H("d")

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