class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: H = None
        self.w: C = None
        self.r: F = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: A = None
        self.x: H = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

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

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

j.q = c
d.r = m
d.t = j
c.o = d
c.r = j
m.s = c
m.w = c
m.t = e
m.r = i
m.o = d
a.s = m
a.r = e
a.q = e
a.u = c
a.v = c
a.o = j
a.t = h
a.x = d
i.r = h
i.w = j
i.x = e
i.u = e
h.y = d
h.o = j
h.t = i
e.v = d
e.u = a
assert h.o.q.r.q.o.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: H = None
        self.w: C = None
        self.r: F = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: A = None
        self.x: H = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.t: F = None
        self.txt = txt

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

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

j.q = c
d.r = m
d.t = j
c.o = d
c.r = j
m.s = c
m.w = c
m.t = e
m.r = i
m.o = d
a.s = m
a.r = e
a.q = e
a.u = c
a.v = c
a.o = j
a.t = h
a.x = d
i.r = h
i.w = j
i.x = e
i.u = e
h.y = d
h.o = j
h.t = i
e.v = d
e.u = a
assert h.o.q.r.q.o.t.q.txt == "c"