class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: D = None
        self.s: G = None
        self.v: D = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.t: H = None
        self.o: H = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: E = None
        self.t: H = None
        self.o: H = None
        self.u: C = None
        self.txt = txt

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

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

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

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