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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.o: F = None
        self.z: B = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: D = None
        self.o: F = None
        self.z: B = None
        self.r: F = None
        self.txt = txt

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

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

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