class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.x: B = None
        self.u: B = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

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

a.o = c
a.w = d
a.x = n
a.u = n
a.p = h
n.s = c
n.p = k
h.p = n
h.z = k
h.y = k
h.v = a
h.t = j
h.w = c
d.w = c
j.s = n
j.p = n
j.v = k
j.x = k
g.z = n
g.q = d
g.r = a
m.z = n
m.q = c
m.r = a
c.w = d
k.p = n
k.z = h
k.y = h
k.v = a
k.t = j
k.w = c
assert d.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.x: B = None
        self.u: B = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

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

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