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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: A = None
        self.w: G = None
        self.u: A = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.txt = txt

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

j = A("j")
i = B("i")
h = C("h")
d = D("d")
g = E("g")
f = F("f")
e = G("e")
b = H("b")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: A = None
        self.w: G = None
        self.u: A = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.txt = txt

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

j = A("j")
i = B("i")
h = C("h")
d = D("d")
g = E("g")
f = F("f")
e = G("e")
b = H("b")

j.r = d
i.y = e
i.r = e
i.p = g
i.s = g
h.q = f
h.r = j
h.u = j
h.w = e
h.o = g
d.q = h
d.t = h
d.v = i
d.s = i
d.w = e
d.x = j
g.p = h
f.q = e
f.u = h
e.z = h
e.x = g
b.w = g
b.z = f
b.q = i
b.r = j
assert j.r.t.w.x.p.q.q.txt == "e"