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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: H = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: H = None
        self.o: H = None
        self.p: H = None
        self.txt = txt

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

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

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

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