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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.p: C = None
        self.v: A = None
        self.u: E = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: H = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.q: A = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.x: A = None
        self.w: E = None
        self.v: F = None
        self.o: D = None
        self.y: D = None
        self.t: D = None
        self.txt = txt

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

k.s = b
b.x = e
b.p = e
b.z = m
b.u = m
b.o = m
b.v = k
b.t = d
e.w = b
e.s = c
e.y = d
e.o = g
d.y = m
d.w = i
d.t = i
d.r = g
d.z = g
d.x = b
d.q = e
d.o = c
m.u = i
g.r = m
i.u = b
i.w = g
i.q = k
i.r = c
c.s = b
c.q = k
c.x = k
c.w = m
c.v = g
c.o = d
c.y = d
c.t = d
assert m.u.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.p: C = None
        self.v: A = None
        self.u: E = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: H = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.q: A = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.x: A = None
        self.w: E = None
        self.v: F = None
        self.o: D = None
        self.y: D = None
        self.t: D = None
        self.txt = txt

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

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