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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: C = None
        self.w: H = None
        self.z: H = None
        self.x: C = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: A = None
        self.u: E = None
        self.s: H = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: G = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: C = None
        self.w: H = None
        self.z: H = None
        self.x: C = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: A = None
        self.u: E = None
        self.s: H = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: G = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

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

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