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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: F = None
        self.q: C = None
        self.z: C = None
        self.s: C = None
        self.p: D = None
        self.txt = txt

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

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

h.s = d
h.q = d
h.o = g
h.x = g
h.y = a
c.p = h
b.s = h
b.r = d
a.v = b
g.w = h
g.o = m
g.q = b
g.z = b
g.s = b
g.p = a
d.p = b
d.q = m
m.p = b
m.q = d
assert d.q.q.p.s.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.o: E = None
        self.y: D = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: F = None
        self.q: C = None
        self.z: C = None
        self.s: C = None
        self.p: D = None
        self.txt = txt

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

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

h.s = d
h.q = d
h.o = g
h.x = g
h.y = a
c.p = h
b.s = h
b.r = d
a.v = b
g.w = h
g.o = m
g.q = b
g.z = b
g.s = b
g.p = a
d.p = b
d.q = m
m.p = b
m.q = d
assert d.q.q.p.s.y.v.txt == "b"