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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.p: H = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.x: E = None
        self.o: F = None
        self.t: F = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

j.w = l
m.t = j
m.z = j
m.p = c
m.q = d
m.y = g
d.p = k
d.o = k
d.t = k
d.r = a
d.x = l
d.y = c
a.r = d
a.o = m
a.t = m
a.p = c
a.y = c
a.x = j
a.q = g
l.t = k
l.o = a
l.v = j
k.x = l
k.q = g
g.t = j
g.p = j
g.u = d
c.w = a
h.t = k
h.o = a
h.v = j
assert h.o.q.p.w.t.q.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.p: H = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: D = None
        self.x: E = None
        self.o: F = None
        self.t: F = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: D = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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