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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: A = None
        self.t: D = None
        self.u: C = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: H = None
        self.t: A = None
        self.z: H = None
        self.q: A = None
        self.x: D = None
        self.w: E = None
        self.s: F = None
        self.txt = txt

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

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

a.o = j
a.v = j
j.w = b
j.r = b
j.q = a
j.t = m
j.u = g
g.q = e
g.r = e
g.p = j
g.w = d
m.q = d
m.u = h
m.w = b
m.v = n
h.w = j
h.q = a
k.r = b
d.u = n
d.p = b
d.z = b
d.t = a
d.q = a
d.x = m
d.w = h
d.s = k
b.z = a
b.o = j
n.q = e
n.r = e
n.p = j
n.w = d
e.r = b
assert b.z.v.t.q.x.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: A = None
        self.t: D = None
        self.u: C = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: H = None
        self.t: A = None
        self.z: H = None
        self.q: A = None
        self.x: D = None
        self.w: E = None
        self.s: F = None
        self.txt = txt

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

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

a.o = j
a.v = j
j.w = b
j.r = b
j.q = a
j.t = m
j.u = g
g.q = e
g.r = e
g.p = j
g.w = d
m.q = d
m.u = h
m.w = b
m.v = n
h.w = j
h.q = a
k.r = b
d.u = n
d.p = b
d.z = b
d.t = a
d.q = a
d.x = m
d.w = h
d.s = k
b.z = a
b.o = j
n.q = e
n.r = e
n.p = j
n.w = d
e.r = b
assert b.z.v.t.q.x.w.o.txt == "j"