class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.q: G = None
        self.u: F = None
        self.x: F = None
        self.w: G = None
        self.v: H = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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