class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

g = A("g")
h = B("h")
m = C("m")
d = D("d")
c = E("c")
a = F("a")
j = E("j")
f = E("f")
b = B("b")

g.s = a
g.z = m
h.x = d
h.y = m
m.z = d
m.x = g
m.u = c
m.q = h
m.o = b
d.u = a
d.s = g
d.q = h
c.u = b
c.q = m
c.z = a
a.s = m
a.o = g
a.r = g
a.u = j
j.u = h
j.q = m
j.z = a
f.u = b
f.q = m
f.z = a
b.x = d
b.y = m
assert m.z.s.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

g = A("g")
h = B("h")
m = C("m")
d = D("d")
c = E("c")
a = F("a")
j = E("j")
f = E("f")
b = B("b")

g.s = a
g.z = m
h.x = d
h.y = m
m.z = d
m.x = g
m.u = c
m.q = h
m.o = b
d.u = a
d.s = g
d.q = h
c.u = b
c.q = m
c.z = a
a.s = m
a.o = g
a.r = g
a.u = j
j.u = h
j.q = m
j.z = a
f.u = b
f.q = m
f.z = a
b.x = d
b.y = m
assert m.z.s.z.q.txt == "h"