class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: A = None
        self.z: B = None
        self.v: C = None
        self.w: E = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: A = None
        self.z: B = None
        self.v: C = None
        self.w: E = None
        self.r: G = None
        self.txt = txt

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

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