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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.x: B = None
        self.y: D = None
        self.o: G = None
        self.z: H = None
        self.w: H = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.x: B = None
        self.y: D = None
        self.o: G = None
        self.z: H = None
        self.w: H = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

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

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