class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: F = None
        self.x: D = None
        self.t: F = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

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

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

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

l.r = d
l.o = d
l.x = g
l.t = e
l.w = n
i.y = n
i.u = n
i.z = n
i.s = n
i.r = g
i.w = c
i.t = l
n.w = l
g.y = c
g.q = l
a.x = k
a.q = i
e.p = d
e.s = d
e.x = a
b.o = n
b.z = n
b.t = n
b.y = l
b.u = l
b.s = l
b.q = k
k.r = d
d.p = e
d.s = e
d.x = a
c.r = e
assert d.s.s.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: F = None
        self.x: D = None
        self.t: F = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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