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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.s: D = None
        self.t: E = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.s: D = None
        self.t: E = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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