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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
e = C("e")
d = D("d")
f = E("f")
j = F("j")
g = D("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
e = C("e")
d = D("d")
f = E("f")
j = F("j")
g = D("g")

m.w = f
m.r = d
m.x = i
m.z = i
m.y = e
m.v = j
i.z = m
i.p = m
i.r = m
i.t = e
i.x = g
e.z = m
d.p = j
d.q = j
d.u = f
d.y = i
f.w = e
f.q = j
f.y = m
j.s = d
g.p = j
g.q = j
g.u = f
g.y = i
assert e.z.r.y.z.w.y.txt == "m"