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

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

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

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

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

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

b = A("b")
h = B("h")
m = C("m")
e = D("e")
l = E("l")
n = F("n")
f = F("f")
c = B("c")
i = C("i")
g = D("g")

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

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

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

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

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

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

b = A("b")
h = B("h")
m = C("m")
e = D("e")
l = E("l")
n = F("n")
f = F("f")
c = B("c")
i = C("i")
g = D("g")

b.s = h
h.s = b
h.y = e
m.q = c
e.y = c
e.s = g
e.w = n
l.w = m
l.v = b
l.y = b
l.z = b
l.t = h
l.o = e
n.s = f
n.r = f
n.t = i
n.y = e
n.p = h
n.x = b
f.s = n
f.r = n
f.t = m
f.y = e
f.p = h
f.x = b
c.s = b
c.y = e
i.q = h
g.y = h
g.s = e
g.w = f
assert m.q.y.s.txt == "g"