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

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

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

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

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

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

m = A("m")
g = B("g")
e = C("e")
f = D("f")
b = E("b")
n = F("n")

m.x = f
m.s = g
m.y = e
m.z = e
m.u = b
g.p = b
g.z = b
e.p = b
e.r = g
e.s = f
f.p = n
f.s = b
f.u = e
f.z = e
f.t = g
b.t = e
b.s = n
n.u = e
n.w = g
n.s = g
n.p = m
n.y = m
assert e.r.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: B = None
        self.y: C = None
        self.z: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

m = A("m")
g = B("g")
e = C("e")
f = D("f")
b = E("b")
n = F("n")

m.x = f
m.s = g
m.y = e
m.z = e
m.u = b
g.p = b
g.z = b
e.p = b
e.r = g
e.s = f
f.p = n
f.s = b
f.u = e
f.z = e
f.t = g
b.t = e
b.s = n
n.u = e
n.w = g
n.s = g
n.p = m
n.y = m
assert e.r.z.t.txt == "e"