class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: C = None
        self.r: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

a = A("a")
n = B("n")
f = C("f")
h = D("h")
j = E("j")
m = F("m")
c = D("c")
d = A("d")

a.s = j
a.w = f
a.r = m
a.o = m
n.s = m
n.v = c
n.p = a
n.o = a
n.y = a
f.y = c
f.u = d
f.s = j
h.q = f
h.w = m
j.w = d
j.u = a
j.p = m
j.x = m
j.v = n
m.r = a
m.u = n
c.q = f
c.w = m
d.s = j
d.w = f
d.r = m
d.o = m
assert h.w.r.o.r.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: C = None
        self.r: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

a = A("a")
n = B("n")
f = C("f")
h = D("h")
j = E("j")
m = F("m")
c = D("c")
d = A("d")

a.s = j
a.w = f
a.r = m
a.o = m
n.s = m
n.v = c
n.p = a
n.o = a
n.y = a
f.y = c
f.u = d
f.s = j
h.q = f
h.w = m
j.w = d
j.u = a
j.p = m
j.x = m
j.v = n
m.r = a
m.u = n
c.q = f
c.w = m
d.s = j
d.w = f
d.r = m
d.o = m
assert h.w.r.o.r.s.u.txt == "a"