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

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

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

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

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

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

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

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

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

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

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

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

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

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

m.q = b
m.y = h
m.t = f
m.z = f
m.s = d
h.z = b
h.y = b
h.r = n
h.t = m
g.t = f
g.x = b
n.x = f
n.q = g
n.r = b
f.s = m
f.v = n
f.w = n
f.y = d
d.r = h
d.v = h
d.u = h
d.z = g
d.y = m
b.x = f
b.q = g
b.r = n
assert n.q.x.x.txt == "f"