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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

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

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