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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: A = None
        self.y: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: E = None
        self.p: D = None
        self.w: D = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

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

m.s = k
m.u = k
m.z = l
m.x = i
l.w = k
l.q = m
l.y = h
l.u = h
k.u = h
k.s = m
k.y = m
k.x = l
d.s = i
i.o = m
i.s = k
i.u = k
i.p = h
h.z = i
h.u = i
h.p = d
h.w = d
h.r = k
h.x = k
assert d.s.p.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: A = None
        self.y: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: E = None
        self.p: D = None
        self.w: D = None
        self.r: C = None
        self.x: C = None
        self.txt = txt

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

m.s = k
m.u = k
m.z = l
m.x = i
l.w = k
l.q = m
l.y = h
l.u = h
k.u = h
k.s = m
k.y = m
k.x = l
d.s = i
i.o = m
i.s = k
i.u = k
i.p = h
h.z = i
h.u = i
h.p = d
h.w = d
h.r = k
h.x = k
assert d.s.p.r.u.txt == "h"