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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.y: B = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

i.r = e
i.s = d
i.y = n
i.w = k
i.t = a
i.z = a
i.q = b
b.s = i
b.w = d
b.p = n
e.w = d
e.r = b
e.s = k
a.p = d
a.t = n
a.y = b
a.r = b
a.x = k
n.y = k
n.q = e
n.r = b
n.z = d
n.t = d
g.z = k
g.q = k
g.y = b
g.x = b
g.r = i
d.x = i
k.v = e
k.p = e
assert d.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: G = None
        self.y: E = None
        self.w: H = None
        self.t: D = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: E = None
        self.y: B = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

i.r = e
i.s = d
i.y = n
i.w = k
i.t = a
i.z = a
i.q = b
b.s = i
b.w = d
b.p = n
e.w = d
e.r = b
e.s = k
a.p = d
a.t = n
a.y = b
a.r = b
a.x = k
n.y = k
n.q = e
n.r = b
n.z = d
n.t = d
g.z = k
g.q = k
g.y = b
g.x = b
g.r = i
d.x = i
k.v = e
k.p = e
assert d.x.s.x.txt == "i"