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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.x: D = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: C = None
        self.q: C = None
        self.z: A = None
        self.r: D = None
        self.o: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.x: D = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: C = None
        self.q: C = None
        self.z: A = None
        self.r: D = None
        self.o: F = None
        self.v: B = None
        self.txt = txt

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

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

b.q = e
h.q = j
h.u = j
h.z = c
h.v = c
h.w = k
h.r = b
j.r = b
j.o = b
j.x = d
j.p = m
j.s = h
d.v = b
e.u = k
e.p = k
e.r = j
e.x = j
m.u = l
m.o = l
m.y = l
m.v = l
m.s = j
m.r = d
m.w = c
m.q = h
l.x = e
l.s = j
l.q = j
l.z = b
l.r = d
l.o = m
l.v = h
k.s = d
k.v = l
c.q = j
c.u = j
c.z = h
c.v = h
c.w = k
c.r = b
assert h.w.v.r.v.q.p.txt == "k"