class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: D = None
        self.z: F = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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