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

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

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

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

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

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

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

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

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

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

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

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

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

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

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