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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: F = None
        self.t: A = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: F = None
        self.t: A = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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