class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: G = None
        self.p: C = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.p: B = None
        self.y: A = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.u: C = None
        self.z: B = None
        self.q: D = None
        self.r: F = 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.v: B = None
        self.u: C = None
        self.p: F = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.p: B = None
        self.y: A = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.u: C = None
        self.z: B = None
        self.q: D = None
        self.r: F = 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.v: B = None
        self.u: C = None
        self.p: F = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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