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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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