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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: F = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: F = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

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

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

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