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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.s: A = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.u: B = None
        self.x: C = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.s: A = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: A = None
        self.u: B = None
        self.x: C = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

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

d.o = b
d.w = a
d.v = h
c.u = m
c.p = m
c.r = b
c.s = l
c.z = l
m.w = h
h.y = l
h.s = l
h.q = c
h.r = d
h.p = m
h.w = a
b.w = a
b.q = c
a.q = b
a.p = l
a.u = c
a.o = c
a.x = m
a.t = m
l.o = j
l.w = a
l.v = h
j.w = a
j.q = c
assert j.q.r.q.r.q.s.o.w.txt == "a"