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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.t: A = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.r: F = None
        self.s: F = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: E = None
        self.u: H = None
        self.s: C = None
        self.p: B = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

g.o = e
g.u = e
g.q = m
g.v = l
g.r = a
d.z = m
d.y = g
d.t = g
d.o = j
b.q = j
b.w = j
b.p = a
b.r = a
b.s = a
e.r = j
e.u = j
e.v = j
e.t = m
e.y = m
e.s = b
e.p = d
m.v = a
m.z = b
a.z = l
a.q = g
a.t = b
l.y = b
l.v = b
l.s = e
l.w = a
l.r = j
l.u = m
l.q = m
j.w = g
j.u = e
j.p = l
j.o = d
assert d.y.o.t.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.u: D = None
        self.v: G = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.t: A = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.r: F = None
        self.s: F = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: E = None
        self.u: H = None
        self.s: C = None
        self.p: B = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

g.o = e
g.u = e
g.q = m
g.v = l
g.r = a
d.z = m
d.y = g
d.t = g
d.o = j
b.q = j
b.w = j
b.p = a
b.r = a
b.s = a
e.r = j
e.u = j
e.v = j
e.t = m
e.y = m
e.s = b
e.p = d
m.v = a
m.z = b
a.z = l
a.q = g
a.t = b
l.y = b
l.v = b
l.s = e
l.w = a
l.r = j
l.u = m
l.q = m
j.w = g
j.u = e
j.p = l
j.o = d
assert d.y.o.t.z.r.txt == "a"